<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
	<? include('../include/header.php'); ?>
    <br /><br /><br />
    
    <pre>  
    <?  //<pre> allows instant formating of the print_r function
	
		$newValue =  "hello";
    		// This is how to create an array in php
		$myArray = array( "Fillhart" => array( "Grade" => 100, "Major" => CPS ),
						  "Andrew" => array( "Grade" => 95), 
						  "Chris" => array( "Grade" => 80));
		$myArray[Mike] = '92'; // will push new value into array.
		
			// This helps you print the array but shouldn't be left in production
		print_r($myArray);
		
			// Example of a standard for loop
		/*for($i = 0; i < count($myArray); $i++)
		{
			echo $newValue . " " . $myArray[$i];	
		}*/
			
		foreach($myArray as $v)
		{
			echo $newValue . " " . $v . "<br />"; //both lines do same thing
			echo "$newValue $v<br />";
		}
		
		foreach($myArray as $k => $v)
		{
			echo "$k got a $v[Grade]<br />";
		}
		
			//Valid action scripted when viewed
		echo json_encode($myArray);
		
	?>
    </pre>
</body>
</html>